﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace week2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en");
        }

        private void opennew_Click(object sender, EventArgs e)
        {
            Form2 formie = new Form2();
            formie.Visible = true;

        }

        private void changeicon_Click(object sender, EventArgs e)
        {
            Icon = Properties.Resources.Icon1;
        }

        private void reseticon_Click(object sender, EventArgs e)
        {
            Icon = default(Icon);
        }

        private void changelanguage_Click(object sender, EventArgs e)
        {
            bool yesno = true;
            if (yesno)
            {
                yesno = false;
                ChangeLanguage("lt-LT");
                
            }
            else
            {
                yesno = true;
                ChangeLanguage("en");
            }
        }
        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void callclass_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }

    }
}
